package domain.entities;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Objetivo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "objetivo", catalog = "bms")
public class Objetivo implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCompromisopais protocoloCompromisopais;
	private String fecha;
	private String objetivo;

	// Constructors

	/** default constructor */
	public Objetivo() {
	}

	/** full constructor */
	public Objetivo(ProtocoloCompromisopais protocoloCompromisopais,
			String fecha, String objetivo) {
		this.protocoloCompromisopais = protocoloCompromisopais;
		this.fecha = fecha;
		this.objetivo = objetivo;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne()
    @LazyCollection(LazyCollectionOption.FALSE)
    @JoinColumns( {
			@JoinColumn(name = "protocoloid", referencedColumnName = "protocoloid", nullable = false),
			@JoinColumn(name = "compromisopaisid", referencedColumnName = "compromisopaisid", nullable = false) })
	public ProtocoloCompromisopais getProtocoloCompromisopais() {
		return this.protocoloCompromisopais;
	}

	public void setProtocoloCompromisopais(
			ProtocoloCompromisopais protocoloCompromisopais) {
		this.protocoloCompromisopais = protocoloCompromisopais;
	}

    @Column(name = "fecha", nullable = false)
    public String getFecha() {
		return this.fecha;
	}

	public void setFecha(String fecha) {
		this.fecha = fecha;
	}

	@Column(name = "objetivo", nullable = false)
	public String getObjetivo() {
		return this.objetivo;
	}

	public void setObjetivo(String objetivo) {
		this.objetivo = objetivo;
	}

}